﻿using System;
using HAVNet.Core;


namespace HAVNet.Intros.AST
{
    public class ASTEmbStmtFor : ASTEmbStmt
    {
        public ASTForInitializer    forInit     { get; set; }
        public ASTExpr              expression  { get; set; }
        public ASTForIterator       forIter     { get; set; }
        public ASTStatement         statement   { get; set; }

        public override string ToString ()
        {
            string sfor = string.Format (
                "for ({0};{1};{2})",
                Lazy.toStringNN(forInit     , ""),
                Lazy.toStringNN(expression  , ""),
                Lazy.toStringNN(forIter     , "")
            ) + Environment.NewLine;

            return sfor + statement.ToString();
        }
    }
}
